package com.spring.sunflower.bean;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

import java.util.List;

/**
 * Created by Kevin on 2021/7/30<br/>
 * <p>
 * Describe:<br/>
 */
public class TalkRepositoryBean2 implements Parcelable {
    @SerializedName("status")
    private String status;
    @SerializedName("message")
    private String message;
    @SerializedName("datas")
    private List<DatasBean> datas;

    protected TalkRepositoryBean2(Parcel in) {
        status = in.readString();
        message = in.readString();
        datas = in.readArrayList(DatasBean.class.getClassLoader());
    }

    public static final Creator<TalkRepositoryBean2> CREATOR = new Creator<TalkRepositoryBean2>() {
        @Override
        public TalkRepositoryBean2 createFromParcel(Parcel in) {
            return new TalkRepositoryBean2(in);
        }

        @Override
        public TalkRepositoryBean2[] newArray(int size) {
            return new TalkRepositoryBean2[size];
        }
    };

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public List<DatasBean> getDatas() {
        return datas;
    }

    public void setDatas(List<DatasBean> datas) {
        this.datas = datas;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(status);
        dest.writeString(message);
        dest.writeList(datas);
    }

    public static class DatasBean implements Parcelable {
        @SerializedName("tag")
        private String tag;
        @SerializedName("contentArray")
        private List<ContentArrayBean> contentArray;

        protected DatasBean(Parcel in) {
            tag = in.readString();
            contentArray = in.readArrayList(ContentArrayBean.class.getClassLoader());
        }

        public static final Creator<DatasBean> CREATOR = new Creator<DatasBean>() {
            @Override
            public DatasBean createFromParcel(Parcel in) {
                return new DatasBean(in);
            }

            @Override
            public DatasBean[] newArray(int size) {
                return new DatasBean[size];
            }
        };

        public String getTag() {
            return tag;
        }

        public void setTag(String tag) {
            this.tag = tag;
        }

        public List<ContentArrayBean> getContentArray() {
            return contentArray;
        }

        public void setContentArray(List<ContentArrayBean> contentArray) {
            this.contentArray = contentArray;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(tag);
            dest.writeList(contentArray);
        }

        public static class ContentArrayBean implements Parcelable{
            @SerializedName("id")
            private String id;
            @SerializedName("type")
            private String type;
            @SerializedName("title")
            private String title;
            @SerializedName("content")
            private String content;

            protected ContentArrayBean(Parcel in) {
                id = in.readString();
                type = in.readString();
                title = in.readString();
                content = in.readString();
            }

            public static final Creator<ContentArrayBean> CREATOR = new Creator<ContentArrayBean>() {
                @Override
                public ContentArrayBean createFromParcel(Parcel in) {
                    return new ContentArrayBean(in);
                }

                @Override
                public ContentArrayBean[] newArray(int size) {
                    return new ContentArrayBean[size];
                }
            };

            public String getId() {
                return id;
            }

            public void setId(String id) {
                this.id = id;
            }

            public String getType() {
                return type;
            }

            public void setType(String type) {
                this.type = type;
            }

            public String getTitle() {
                return title;
            }

            public void setTitle(String title) {
                this.title = title;
            }

            public String getContent() {
                return content;
            }

            public void setContent(String content) {
                this.content = content;
            }

            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel dest, int flags) {
                dest.writeString(id);
                dest.writeString(type);
                dest.writeString(title);
                dest.writeString(content);
            }
        }
    }
}
